/**
 * Copyright (c) 2014, 2017, Oracle and/or its affiliates.
 * The Universal Permissive License (UPL), Version 1.0
 */
"use strict";
define(["ojs/ojcore","jquery","promise","ojs/ojdatasource-common"],function(a,g){a.Fb=function(a,c){this.Init();this.Ca=a;this.Wj=c;this.ux()};o_("Cube",a.Fb,a);a.b.sa(a.Fb,a.b,"oj.Cube");a.Fb.prototype.Init=function(){a.Fb.u.Init.call(this)};a.Fb.prototype.gr=function(){var a=this.C8(),c=[];Array.prototype.push.apply(c,a?a.gr():this.Vh);for(a=2;a<this.Vh.length;a++)c.push(this.Vh[a]);return c};a.b.g("Cube.prototype.getAxes",{gr:a.Fb.prototype.gr});a.Fb.prototype.MT=function(){return this.Vh};a.Fb.prototype.mr=
function(a){var c=this.C8();a=c.PAa(a);for(a=c=c.Jea(a,0,[]);Array.isArray(a)&&1===a.length;)if(a=a[0],!Array.isArray(a))return a;return c};a.b.g("Cube.prototype.getValues",{mr:a.Fb.prototype.mr});a.Fb.prototype.setPage=function(a){this.QV=a instanceof Array?a:[a]};a.Fb.prototype.lja=function(b,c,d,e,f){var g=this.Wj,k=this.a7(b);if(!k)return!1;b=null;d<g.length?b=this.a7(d):(b={axis:d,levels:[]},g.push(b));d=k.levels;g=b.levels;b=c<d.length?d[c]:null;if(!b)return!1;e>=g.length?(g.push(b),d.splice(c,
1)):f===a.Fb.oP.SWAP?(d[c]=g[e],g[e]=b):(f===a.Fb.oP.AFTER&&e++,g.splice(e,0,b),g===d&&e<c&&c++,d.splice(c,1));this.ux();return!0};a.b.g("Cube.prototype.pivot",{lja:a.Fb.prototype.lja});a.Fb.prototype.a7=function(a){for(var c=0;c<this.Wj.length;c++)if(this.Wj[c].axis===a)return this.Wj[c];return null};a.Fb.prototype.PM=function(){return this.Wj};a.b.g("Cube.prototype.getLayout",{PM:a.Fb.prototype.PM});a.Fb.oP={BEFORE:"before",AFTER:"after",SWAP:"swap"};o_("Cube.PivotType",a.Fb.oP,a);a.Fb.prototype.Jea=
function(a,c,d){var e=[];if(0===a.length)return c=d.slice(0),this.Zh(c);var f=a.slice(1),g=a[0].start;a=a[0].count;for(d[c]=g;d[c]<g+a;d[c]++)e.push(this.Jea(f,c+1,d));return e};a.Fb.prototype.PAa=function(a){var c=[];if(!a)return c;for(var d=Math.min(a.length,this.Vh.length),e=0;e<d;e++){var f=a[e];f instanceof Object&&(f.hasOwnProperty("start")||f.hasOwnProperty("count"))?f.hasOwnProperty("start")?f.hasOwnProperty("count")?c.push(this.hJ(f.start,f.count,e)):c.push(this.hJ(f.start,1,e)):c.push(this.hJ(0,
f.count,e)):c.push(this.hJ(f,1,e))}return c};a.Fb.prototype.hJ=function(a,c,d){d=this.gr()[d].getExtent();if(a>=d||0>a)a=0;c=Math.min(c,d-a);return{start:a,index:a,count:c}};a.Fb.prototype.Zh=function(b){var c=this.Rra(b);return c&&(c=c.Au(),0<c.length&&(c=this.i[c[0].key]))?new a.Ji(c.value,b,c.fM,c.rows,c.iu):new a.Ji(null,b,void 0,[])};a.Fb.prototype.lla=function(){var a=this.yva();this.QV=[];for(var c=0;c<a.length;c++)this.yq(a[c].axis,a[c].levels),this.QV.push({axis:a[c].axis,index:0});if(0===
a.length)for(a=this.MT(),c=0;c<a.length;c++)this.yq(a[c].axis,a[c].levels)};a.Fb.prototype.yva=function(){for(var a=[],c=0;c<this.Wj.length;c++)1<this.Wj[c].axis&&a.push(this.Wj[c]);return a};a.Fb.prototype.MT=function(){for(var a=[],c=0;c<this.Wj.length;c++)2>this.Wj[c].axis&&a.push(this.Wj[c]);return a};a.Fb.prototype.ux=function(){this.Vh=[];this.i=[];this.pS=[];this.lla();if(null!==this.Ca)for(var b=0;b<this.Ca.length;b++){for(var c=new a.Em,d=2;d<this.Vh.length;d++)c=this.Vh[d].P0(this.Ca[b],
c);for(var c=c.Au(),e=0;e<c.length;e++){var d=c[e].key,f=this.pS[d];f||(f=this.pS[d]=this.VO(this.MT()));for(var g=new a.Em,k=f.Vh.length,d=0;d<k;d++)g=f.Vh[d].P0(this.Ca[b],g);g=d=g.Au();if(void 0!==c[e].Ffa)for(g=[],k=0;k<d.length;k++)g.push(c[e]);f.NEa(d,g,this.Ca[b])}}};a.Fb.prototype.NEa=function(a,c,d){for(var e=0;e<a.length;e++)this.i[a[e].key]=this.Rpa(c[e],this.i[a[e].key],d)};a.Fb.prototype.C8=function(){return this.pS[this.$ua(this.QV)]};a.Fb.prototype.$ua=function(b){var c=new a.Em;if(b&&
0<b.length){b.sort(function(a,b){return a.axis-b.axis});for(var d=this.Vh,e=0;e<b.length;e++)c=d[b[e].axis].NG(b[e].index,c)}return c.Au()[0].key};a.Fb.gaa=function(a){return a?void 0!==a.value&&null!==a.value:!1};a.Fb.prototype.Ud=function(a,c,d,e,f){d.push(e);e={};for(var g in f)f.hasOwnProperty(g)&&(e[g]=f[g]);e.value=a;e.fM=c;e.rows=d;return e};a.Fb.Mg=function(b){return a.cb.Re(b.value)?!1:!isNaN(b.value)};a.Fb.prototype.Rpa=function(b,c,d){var e=this.XO(b.Ffa),f=e.Xz,g=a.Fb.gaa(c),k=a.Fb.gaa(b),
l=g&&a.Fb.Mg(c),m=k&&a.Fb.Mg(b);switch(f){case a.Ii.SUM:return g&&k?l&&m?this.Ud(c.value+b.value,f,c.rows,d,{}):this.Ud(NaN,f,c.rows,d,{}):k&&!g?m?this.Ud(b.value,f,[],d,{}):this.Ud(NaN,f,[],d,{}):c;case a.Ii.AVERAGE:return g&&k?l&&m?this.Ud((c.kB+b.value)/(c.rows.length+1),f,c.rows,d,{kB:c.kB+b.value}):this.Ud(NaN,f,c.rows,d,{kB:c.kB}):k&&!g?m?this.Ud(b.value,f,[],d,{kB:b.value}):this.Ud(NaN,f,[],d,{kB:NaN}):c;case a.Ii.VARIANCE:case a.Ii.STDDEV:return g&&k?l&&m?(g=c.value+(b.value-c.value)/(c.rows.length+
1),this.Ud(g,f,c.rows,d,{iu:c.iu+(b.value-c.value)*(b.value-g)})):this.Ud(NaN,f,c.rows,d,{iu:NaN}):k&&!g?m?this.Ud(b.value,f,[],d,{iu:0}):this.Ud(NaN,f,[],d,{iu:NaN}):c;case a.Ii.NONE:return this.Ud(null,f,g?c.rows:[],d,{});case a.Ii.FIRST:return g?this.Ud(c.value,f,c.rows,d,{}):k?this.Ud(b.value,f,[],d,{}):c;case a.Ii.MIN:return g&&k?l&&m?this.Ud(Math.min(c.value,b.value),f,c.rows,d,{}):this.Ud(NaN,f,c.rows,d,{}):k&&!g?m?this.Ud(b.value,f,[],d,{}):this.Ud(NaN,f,[],d,{}):c;case a.Ii.MAX:return g&&
k?l&&m?this.Ud(Math.max(c.value,b.value),f,c.rows,d,{}):this.Ud(NaN,f,c.rows,d,{}):k&&!g?m?this.Ud(b.value,f,[],d,{}):this.Ud(NaN,f,[],d,{}):c;case a.Ii.COUNT:return g&&k?this.Ud(c.value+1,f,c.rows,d,{}):k&&!g?this.Ud(1,f,[],d,{}):c;case a.Ii.CUSTOM:return b=e.Mc.call(this,g?c.value:void 0,k?b.value:void 0),this.Ud(b,f,g?c.rows:[],d,{})}};a.Fb.prototype.yq=function(b,c){b>=this.Vh.length&&Array.prototype.push.apply(this.Vh,Array(b-this.Vh.length+1));this.Vh[b]||(this.Vh[b]=new a.Fh(c,b,this));return this.Vh[b]};
a.Fb.prototype.Rra=function(b){for(var c=this.gr(),d=new a.Em,e=0;e<b.length;e++)d=c[e].NG(b[e],d);return d};a.Fb.prototype.Kx=function(){a.p.kd()};a.Fb.prototype.VO=function(){a.p.kd()};a.Fb.prototype.WO=function(){a.p.kd()};a.Fb.prototype.XO=function(){a.p.kd();return{}};a.Ii={SUM:"sum",AVERAGE:"avg",STDDEV:"stddev",VARIANCE:"variance",NONE:"none",FIRST:"first",MIN:"min",MAX:"max",COUNT:"count",CUSTOM:"custom"};o_("CubeAggType",a.Ii,a);a.hd=function(a,c,d,e){this.Init();this.tf=[];this.aw=e;this.Gsa=
d;this.i={};this.i.value=a;this.i.label=c};o_("CubeAxisValue",a.hd,a);a.b.sa(a.hd,a.b,"oj.CubeAxisValue");a.hd.prototype.Init=function(){a.hd.u.Init.call(this)};a.hd.prototype.Kw=function(){return this.Gsa};a.b.g("CubeAxisValue.prototype.getLevel",{Kw:a.hd.prototype.Kw});a.hd.prototype.getDepth=function(){return 1};a.b.g("CubeAxisValue.prototype.getDepth",{getDepth:a.hd.prototype.getDepth});a.hd.prototype.Fga=function(){for(var a=[],c=this.aw;c&&c.aw;)a.unshift(c),c=c.aw;return a};a.b.g("CubeAxisValue.prototype.getParents",
{Fga:a.hd.prototype.Fga});a.hd.prototype.getChildren=function(){return this.tf};a.b.g("CubeAxisValue.prototype.getChildren",{getChildren:a.hd.prototype.getChildren});a.hd.prototype.getExtent=function(){if(-1<this.Ky)return this.Ky;if(this.tf&&0!==this.tf.length)for(var a=this.Ky=0;a<this.getChildren().length;a++)this.Ky+=this.getChildren()[a].getExtent();else this.Ky=1;return this.Ky};a.b.g("CubeAxisValue.prototype.getExtent",{getExtent:a.hd.prototype.getExtent});a.hd.prototype.getStart=function(){if(-1<
this.ak)return this.ak;if(!this.aw)return 0;for(var a=this.aw.getStart(),c=this.aw.F8(this);c;)a+=c.getExtent(),c=this.aw.F8(c);return this.ak=a};a.b.g("CubeAxisValue.prototype.getStart",{getStart:a.hd.prototype.getStart});a.hd.prototype.ie=function(){return this.i.value};a.b.g("CubeAxisValue.prototype.getValue",{ie:a.hd.prototype.ie});a.hd.prototype.RY=function(){return this.i.label?this.i.label:this.ie()};a.b.g("CubeAxisValue.prototype.getLabel",{RY:a.hd.prototype.RY});a.hd.prototype.mla=function(a){var c=
this.uua();if(null===c)return null;if(c.CA())return this.Iua(a);if(a=a[c.attribute])for(c=0;c<this.tf.length;c++)if(this.tf[c].ie()===a)return this.tf[c];return null};a.hd.prototype.Iua=function(a){for(var c=0;c<this.tf.length;c++){var d=this.tf[c].ie();if(a.hasOwnProperty(d)&&a[d]===d)return this.tf[c]}return null};a.hd.prototype.uua=function(){return this.tf&&0<this.tf.length?this.tf[0].Kw():null};a.hd.prototype.nla=function(a){return this.US(a,0,this.tf.length-1)};a.hd.prototype.US=function(a,
c,d){if(c>d)return null;var e=Math.floor((c+d)/2),f=this.tf[e],g=f.getStart();return g>a?this.US(a,c,e-1):g+f.getExtent()-1<a?this.US(a,e+1,d):f};a.hd.prototype.GO=function(b,c,d){for(var e=0;e<this.tf.length;e++)if(this.tf[e].ie()===b)return this.tf[e];b=new a.hd(b,c,d,this);this.tf.push(b);return b};a.hd.prototype.ola=function(){var a={};a[this.Kw().attribute]=this.ie();return a};a.hd.prototype.F8=function(a){for(var c=0;c<this.tf.length;c++)if(this.tf[c]===a){if(0<c)return this.tf[c-1];break}return null};
a.Fh=function(b,c,d){this.Init();this.axis=c;this.paa=[];for(c=0;c<b.length;c++)this.paa.push(d.WO(b[c],this));this.OC=d;this.Sg=new a.hd(null,null,null,null)};o_("CubeAxis",a.Fh,a);a.b.sa(a.Fh,a.b,"oj.CubeAxis");a.Fh.prototype.Init=function(){a.Fh.u.Init.call(this)};a.Fh.prototype.xp=function(){return this.paa};a.b.g("CubeAxis.prototype.getLevels",{xp:a.Fh.prototype.xp});a.Fh.prototype.getExtent=function(){return this.Sg.getExtent()};a.b.g("CubeAxis.prototype.getExtent",{getExtent:a.Fh.prototype.getExtent});
a.Fh.prototype.mr=function(a){for(var c=[],d=this.Sg;d;)(d=d.nla(a))&&c.push(d);return c};a.b.g("CubeAxis.prototype.getValues",{mr:a.Fh.prototype.mr});a.Fh.prototype.dl=function(a){a=a?JSON.parse(a):{};for(var c=this.Sg,d=null;c;)d=c,c=c.mla(a);return d?d.getStart():-1};a.b.g("CubeAxis.prototype.getIndex",{dl:a.Fh.prototype.dl});a.Fh.prototype.NG=function(a,c){return this.w0(a,this.xp().length-1,c)};a.Fh.prototype.w0=function(a,c,d){a=this.mr(a);c=this.xp()[c];for(var e=0;e<a.length;e++){var f=a[e];
f.Kw().CA()?d.FO(f.ie()):d.CP(f);if(f.Kw()===c)break}return d};a.Fh.prototype.P0=function(a,c){return this.OC.Kx(this,0,this.Sg,a,c,!0)};a.Ji=function(a,c,d,e,f){this.Init();this.i={};this.i.value=a;this.i.yJa=c;this.i.fM=d;this.i.rows=e;this.i.iu=f};o_("CubeDataValue",a.Ji,a);a.b.sa(a.Ji,a.b,"oj.CubeDataValue");a.Ji.prototype.Init=function(){a.Ji.u.Init.call(this)};a.Ji.prototype.ie=function(){switch(this.i.fM){case a.Ii.STDDEV:return Math.sqrt(this.k9());case a.Ii.VARIANCE:return this.k9();default:return this.i.value}};
a.b.g("CubeDataValue.prototype.getValue",{ie:a.Ji.prototype.ie});a.Ji.prototype.yga=function(){return this.i.yJa};a.b.g("CubeDataValue.prototype.getIndices",{yga:a.Ji.prototype.yga});a.Ji.prototype.Mga=function(){return this.i.rows};a.b.g("CubeDataValue.prototype.getRows",{Mga:a.Ji.prototype.Mga});a.Ji.prototype.aga=function(){return this.i.fM};a.b.g("CubeDataValue.prototype.getAggregation",{aga:a.Ji.prototype.aga});a.Ji.prototype.k9=function(){if(isNaN(this.i.iu))return NaN;var a=this.i.rows.length;
return 1<a?this.i.iu/(a-1):0};a.Dm=function(b,c){var d=c.row?c.row.start:0,e=c.row?c.row.count:0,f=c.column?c.column.start:0,g=c.column?c.column.count:0;a.p.Uq(d,null);a.p.Uq(e,null);a.p.Uq(f,null);a.p.Uq(g,null);this.OC=b;this.ZW={row:d,column:f};this.Sg=this.OC.mr([{start:f,count:g},{start:d,count:e}]);g=(d=Array.isArray(this.Sg))?this.Sg.length:1;0<g&&(e=d?this.Sg[0].length:1);this.Mra={row:e,column:g}};o_("CubeCellSet",a.Dm,a);a.Dm.prototype.getData=function(a){var c=a.row;a=a.column;return(c=
Array.isArray(this.Sg)?this.Sg[a-this.ZW.column][c-this.ZW.row]:this.Sg)?c.ie():null};a.b.g("CubeCellSet.prototype.getData",{getData:a.Dm.prototype.getData});a.Dm.prototype.getMetadata=function(a){var c={keys:{}};c.keys.row=this.t7(a,"row",2);c.keys.column=this.t7(a,"column",1);return c};a.b.g("CubeCellSet.prototype.getMetadata",{getMetadata:a.Dm.prototype.getMetadata});a.Dm.prototype.t7=function(b,c,d){var e=this.OC.gr();return void 0!==b[c]&&e.length>=d?(d=new a.Em,d=e[a.Ic.K5(c)].NG(b[c],d),d.Au()[0].key):
null};a.Dm.prototype.getStart=function(a){return this.ZW[a]};a.b.g("CubeCellSet.prototype.getStart",{getStart:a.Dm.prototype.getStart});a.Dm.prototype.getCount=function(a){return this.Mra[a]};a.b.g("CubeCellSet.prototype.getCount",{getCount:a.Dm.prototype.getCount});a.Li=function(b,c,d){this.Init();this.Ds=d;this.rR();a.Li.u.constructor.call(this,b,c)};o_("DataValueAttributeCube",a.Li,a);a.b.sa(a.Li,a.Fb,"oj.DataValueAttributeCube");a.Li.prototype.Ca=null;a.Li.prototype.Init=function(){a.Li.u.Init.call(this)};
a.Li.prototype.ux=function(){a.Li.u.ux.call(this)};a.Li.prototype.XO=function(a){return this.Dy[a]};a.Li.prototype.WO=function(b,c){return b.dataValue?new a.xj(null,c,!0):new a.xj(b.attribute,c,!1)};a.Li.prototype.VO=function(b){return new a.Li(null,b,this.Ds)};a.Li.prototype.Kx=function(a,c,d,e,f,g){if(c>=a.xp().length)return f;var k=a.xp()[c];if(k.CA())return this.zBa(a,d,e,c,f);d=d.GO(e[k.attribute],null,k);g&&f.CP(d);return this.Kx(a,c+1,d,e,f,g)};a.Li.prototype.zBa=function(a,c,d,e,f){for(var g=
!0,k=0;k<this.Ds.length;k++){var l=this.Ds[k].attribute,m=this.Ds[k].label;d.hasOwnProperty(l)&&(m=c.GO(l,m,a.xp()[e]),f.FO(l,d[l]),this.Kx(a,e+1,m,d,f,g),g=!1)}return f};a.Li.prototype.rR=function(){this.Dy=[];for(var b=0;b<this.Ds.length;b++){var c=this.Ds[b];this.Dy[c.attribute]=c.aggregation?{Xz:c.aggregation,Mc:c.callback}:{Xz:a.Ii.SUM,Mc:c.callback}}};a.Em=function(){this.oV=[];this.i=[]};a.Em.prototype.CP=function(a){this.oV.push(a)};a.Em.prototype.FO=function(a,c){this.i.push({name:a,value:c})};
a.Em.prototype.Au=function(){var a=[],c=this.yqa();if(0===this.i.length)a.push({key:JSON.stringify(c)});else for(var d=0;d<this.i.length;d++){var e=g.extend(!0,{},c);e[this.i[d].name]=this.i[d].name;a.push({key:JSON.stringify(e),Ffa:this.i[d].name,value:this.i[d].value})}return a};a.Em.prototype.yqa=function(){for(var a={},c=0;c<this.oV.length;c++){var d=this.oV[c].ola(),e;for(e in d)d.hasOwnProperty(e)&&(a[e]=d[e])}return a};a.ah=function(a,c,d,e){this.OC=c;this.wC=a;this.ak=void 0===d?0:d;this.Kra=
void 0===e?this.wC.getExtent():Math.min(e,this.wC.getExtent()-d);this.N6=d+e-1};o_("CubeHeaderSet",a.ah,a);a.ah.prototype.getData=function(a,c){var d=this.Zh(a,c);return d?d.RY():null};a.b.g("CubeHeaderSet.prototype.getData",{getData:a.ah.prototype.getData});a.ah.prototype.getMetadata=function(b,c){var d=new a.Em,d=this.wC.w0(b,c,d);return(d=d.Au())&&0<d.length?{key:d[0].key}:null};a.b.g("CubeHeaderSet.prototype.getMetadata",{getMetadata:a.ah.prototype.getMetadata});a.ah.prototype.getLevelCount=function(){return this.wC.xp().length};
a.b.g("CubeHeaderSet.prototype.getLevelCount",{getLevelCount:a.ah.prototype.getLevelCount});a.ah.prototype.getExtent=function(a,c){var d=this.Zh(a,c),e=d.getExtent(),d=d.getStart(),f=d+e-1,g=a<d+e-1;d<this.ak&&(e-=this.ak-d);f>this.N6&&(e-=f-this.N6);return{extent:e,more:{before:a>d,after:g}}};a.b.g("CubeHeaderSet.prototype.getExtent",{getExtent:a.ah.prototype.getExtent});a.ah.prototype.getDepth=function(a,c){return this.Zh(a,c).getDepth()};a.b.g("CubeHeaderSet.prototype.getDepth",{getDepth:a.ah.prototype.getDepth});
a.ah.prototype.getCount=function(){return this.Kra};a.b.g("CubeHeaderSet.prototype.getCount",{getCount:a.ah.prototype.getCount});a.ah.prototype.getStart=function(){return this.ak};a.b.g("CubeHeaderSet.prototype.getStart",{getStart:a.ah.prototype.getStart});a.ah.prototype.Zh=function(a,c){void 0===c&&(c=0);var d=this.wC.mr(a);return d&&d.length>c?d[c]:null};a.Ic=function(b){a.Ic.u.constructor.call(this,b)};o_("CubeDataGridDataSource",a.Ic,a);a.b.sa(a.Ic,a.Rr,"oj.CubeDataGridDataSource");a.Ic.prototype.Rja=
function(a){this.data=a;this.h7()};a.b.g("CubeDataGridDataSource.prototype.setCube",{Rja:a.Ic.prototype.Rja});a.Ic.prototype.setPage=function(a){this.data.setPage(a);this.h7()};a.b.g("CubeDataGridDataSource.prototype.setPage",{setPage:a.Ic.prototype.setPage});a.Ic.prototype.h7=function(){this.handleEvent("change",{source:this,operation:"refresh"})};a.Ic.prototype.getCount=function(a){return(a=this.yq(a))?a.getExtent():0};a.b.g("CubeDataGridDataSource.prototype.getCount",{getCount:a.Ic.prototype.getCount});
a.Ic.prototype.getCountPrecision=function(){return"exact"};a.b.g("CubeDataGridDataSource.prototype.getCountPrecision",{getCountPrecision:a.Ic.prototype.getCountPrecision});a.Ic.prototype.fetchHeaders=function(b,c,d){var e=new a.ah(this.yq(b.axis),this.data,b.start,b.count);c.success.call(d?d.success:void 0,e,b)};a.b.g("CubeDataGridDataSource.prototype.fetchHeaders",{fetchHeaders:a.Ic.prototype.fetchHeaders});a.Ic.prototype.fetchCells=function(b,c,d){for(var e={},f=0;f<b.length;f++){var g=void 0===
b[f].start?0:b[f].start;if("row"===b[f].axis){var k=void 0===b[f].count?this.data.gr()[1].getExtent():b[f].count;e.row={start:g,count:k}}"column"===b[f].axis&&(k=void 0===b[f].count?this.data.gr()[0].getExtent():b[f].count,e.column={start:g,count:k})}e=new a.Dm(this.data,e);c.success.call(d?d.success:void 0,e,b)};a.b.g("CubeDataGridDataSource.prototype.fetchCells",{fetchCells:a.Ic.prototype.fetchCells});a.Ic.prototype.keys=function(a){var c={},c=this.ic(a,"row",c),c=this.ic(a,"column",c);return Promise.resolve(c)};
a.b.g("CubeDataGridDataSource.prototype.keys",{keys:a.Ic.prototype.keys});a.Ic.prototype.ic=function(b,c,d){var e=this.yq(c);b=b[c];var f=new a.Em,f=e?e.NG(b,f):"";d[c]=f.Au()[0].key;return d};a.Ic.prototype.indexes=function(a){var c={},c=this.Pj(a,"row",c),c=this.Pj(a,"column",c);return Promise.resolve(c)};a.b.g("CubeDataGridDataSource.prototype.indexes",{indexes:a.Ic.prototype.indexes});a.Ic.prototype.Pj=function(a,c,d){d[c]=this.yq(c).dl(a[c]);return d};a.Ic.prototype.sort=function(){a.p.kd()};
a.b.g("CubeDataGridDataSource.prototype.sort",{sort:a.Ic.prototype.sort});a.Ic.prototype.move=function(){a.p.kd()};a.b.g("CubeDataGridDataSource.prototype.move",{move:a.Ic.prototype.move});a.Ic.prototype.moveOK=function(){return"invalid"};a.b.g("CubeDataGridDataSource.prototype.moveOK",{moveOK:a.Ic.prototype.moveOK});a.Ic.prototype.getCapability=function(a){switch(a){case "sort":return"none";case "move":return"none"}return null};a.b.g("CubeDataGridDataSource.prototype.getCapability",{getCapability:a.Ic.prototype.getCapability});
a.Ic.K5=function(a){return"row"===a?1:0};a.Ic.prototype.yq=function(b){b=a.Ic.K5(b);var c=this.data.gr();return c.length>b?c[b]:null};a.Ki=function(b,c,d){this.Init();this.Ds=d;this.SFa=d.valueAttr;this.Rza=d.labelAttr;var e=d.defaultAggregation;this.i6=e?a.Ki.Kua(e):{Xz:a.Ii.SUM};this.gR=d.aggregation;this.rR();a.Ki.u.constructor.call(this,b,c)};o_("DataColumnCube",a.Ki,a);a.b.sa(a.Ki,a.Fb,"oj.DataColumnCube");a.Ki.prototype.Init=function(){a.Ki.u.Init.call(this)};a.Ki.prototype.ux=function(){a.Ki.u.ux.call(this)};
a.Ki.prototype.XO=function(a){return this.Dy[a]?this.Dy[a]:this.i6};a.Ki.prototype.VO=function(b){return new a.Ki(null,b,this.Ds)};a.Ki.prototype.WO=function(b,c){return b.attribute===this.Rza?new a.xj(b.attribute,c,!0):new a.xj(b.attribute,c,!1)};a.Ki.prototype.Kx=function(a,c,d,e,f,g){if(c>=a.xp().length)return f;var k=a.xp()[c],l=e[k.attribute];d=d.GO(l,null,k);k.CA()?f.FO(l,e[this.SFa]):f.CP(d);return this.Kx(a,c+1,d,e,f,g)};a.Ki.Kua=function(b){return a.cb.Re(b)?{Xz:b}:{Xz:b.aggregation,Mc:b.callback}};
a.Ki.prototype.rR=function(){this.Dy=[];if(this.gR)for(var a=0;a<this.gR.length;a++){var c=this.gR[a],d=c.aggregation;this.Dy[c.value]=d?{Xz:d,Mc:c.callback}:this.i6}};a.xj=function(a,c,d){this.Init();this.attribute=a;this.w4=c;this.axis=c.axis;this.h6=d};o_("CubeLevel",a.xj,a);a.b.sa(a.xj,a.b,"oj.CubeLevel");a.xj.prototype.Init=function(){a.xj.u.Init.call(this)};a.xj.prototype.ie=function(a){if(a=this.w4.mr(a))for(var c=0;c<a.length;c++)if(a[c].Kw()===this)return a[c];return null};a.b.g("CubeLevel.prototype.getValue",
{ie:a.xj.prototype.ie});a.xj.prototype.CA=function(){return this.h6};a.b.g("CubeLevel.prototype.isDataValue",{CA:a.xj.prototype.CA});a.xj.prototype.h6=!1;a.xj.prototype.w4=null});